<style>

</style>
<template>
  <el-dialog
    title="节点组件编写"
    :visible.sync="dialogVisible"
    :close-on-press-escape="false"
    :close-on-click-modal="false"
    width="80%"
    :before-close="clearForm">
    <el-input v-model="pluginContext" type="textarea" :rows="4" placeholder="上下文数据"></el-input>
    <code-viewer style="margin-top: 15px" :showCode="true" layout="right" :source="code" :errorHandler="errorFunc"></code-viewer>
    <span slot="footer" class="dialog-footer">
    <el-button @click="clearForm">取 消</el-button>
  </span>
  </el-dialog>
</template>
<script>

export default {
  name: "buryingForm",
  filters: {},
  components: {},
  data() {
    return {
      pluginContext: '',
      dialogVisible: false,
      code: "<template>\n  <div id=\"app\">\n    <p style=\"color:red\"> {{ name }} </p>\n    <p>Let's start your performance now~</p>\n  </div>\n</template>\n\n<style scoped>\n\n</style>\n\n<script>\n\nexport default {\n  props: [\"pluginContext\"],\n  name: \"demo-code\",\n  data() {\n    return {\n      name: 'BIC-Business inspection chart MVP Version'\n    };\n  }\n};\n<\/script>"
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    load() {
      let vm = this
      vm.dialogVisible = true
    },
    clearForm() {
      let vm = this
      vm.dialogVisible = false
    },
    errorFunc(errMsg) {
      debugger
      console.log(errMsg)
      this.$message({type: 'success', message: errMsg});
    }
  }
}
</script>
